<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>wickr-crypto-c: Wickr_dev_info</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">wickr-crypto-c
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Wickr_dev_info</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structwickr__dev__info.html">wickr_dev_info</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Device Information used to make a uniquely identifying set of data for each context running the Wickr Protocol.  <a href="structwickr__dev__info.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gaadd5ceb4c6ed757440332e8e27109e5e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__dev__info.html">wickr_dev_info_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__dev__info.html#gaadd5ceb4c6ed757440332e8e27109e5e">wickr_dev_info_create</a> (<a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *dev_salt, <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *system_salt, <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *msg_proto_id, <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *srv_comm_id)</td></tr>
<tr class="separator:gaadd5ceb4c6ed757440332e8e27109e5e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gadbe4731cffb188da317ed9237826ac5d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__dev__info.html">wickr_dev_info_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__dev__info.html#gadbe4731cffb188da317ed9237826ac5d">wickr_dev_info_create_new</a> (const <a class="el" href="structwickr__crypto__engine.html">wickr_crypto_engine_t</a> *crypto, const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *system_id)</td></tr>
<tr class="separator:gadbe4731cffb188da317ed9237826ac5d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7f81b96fc222560762d608772b3f44bd"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__dev__info.html">wickr_dev_info_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__dev__info.html#ga7f81b96fc222560762d608772b3f44bd">wickr_dev_info_derive</a> (const <a class="el" href="structwickr__crypto__engine.html">wickr_crypto_engine_t</a> *crypto, <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *dev_salt, const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *system_id)</td></tr>
<tr class="separator:ga7f81b96fc222560762d608772b3f44bd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1c9d2bdc1778166c49aec43906bb1a83"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__dev__info.html">wickr_dev_info_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__dev__info.html#ga1c9d2bdc1778166c49aec43906bb1a83">wickr_dev_info_copy</a> (const <a class="el" href="structwickr__dev__info.html">wickr_dev_info_t</a> *info)</td></tr>
<tr class="separator:ga1c9d2bdc1778166c49aec43906bb1a83"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga09ee324a0e0e6a0451aa53031eecb324"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__dev__info.html#ga09ee324a0e0e6a0451aa53031eecb324">wickr_dev_info_destroy</a> (<a class="el" href="structwickr__dev__info.html">wickr_dev_info_t</a> **info)</td></tr>
<tr class="separator:ga09ee324a0e0e6a0451aa53031eecb324"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga1c9d2bdc1778166c49aec43906bb1a83"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1c9d2bdc1778166c49aec43906bb1a83">&#9670;&nbsp;</a></span>wickr_dev_info_copy()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__dev__info.html">wickr_dev_info_t</a>* wickr_dev_info_copy </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structwickr__dev__info.html">wickr_dev_info_t</a> *&#160;</td>
          <td class="paramname"><em>info</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Copy a device info set</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">info</td><td>the source info to copy </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a newly allocated device info set containing deep copies of the properties of 'info' </dd></dl>

</div>
</div>
<a id="gaadd5ceb4c6ed757440332e8e27109e5e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaadd5ceb4c6ed757440332e8e27109e5e">&#9670;&nbsp;</a></span>wickr_dev_info_create()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__dev__info.html">wickr_dev_info_t</a>* wickr_dev_info_create </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td>
          <td class="paramname"><em>dev_salt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td>
          <td class="paramname"><em>system_salt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td>
          <td class="paramname"><em>msg_proto_id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td>
          <td class="paramname"><em>srv_comm_id</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Create a device info set from components</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">dev_salt</td><td>random salt, see property declaration of '<a class="el" href="structwickr__dev__info.html" title="Device Information used to make a uniquely identifying set of data for each context running the Wickr...">wickr_dev_info</a>' </td></tr>
    <tr><td class="paramname">system_salt</td><td>system bound salt, see property declaration of '<a class="el" href="structwickr__dev__info.html" title="Device Information used to make a uniquely identifying set of data for each context running the Wickr...">wickr_dev_info</a>' </td></tr>
    <tr><td class="paramname">msg_proto_id</td><td>messaging protocol identifier, see property declaration of '<a class="el" href="structwickr__dev__info.html" title="Device Information used to make a uniquely identifying set of data for each context running the Wickr...">wickr_dev_info</a>' </td></tr>
    <tr><td class="paramname">srv_comm_id</td><td>server communication identifier, see property declaration of '<a class="el" href="structwickr__dev__info.html" title="Device Information used to make a uniquely identifying set of data for each context running the Wickr...">wickr_dev_info</a>' </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a newly allocated device info set owning the properties passed in </dd></dl>

</div>
</div>
<a id="gadbe4731cffb188da317ed9237826ac5d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gadbe4731cffb188da317ed9237826ac5d">&#9670;&nbsp;</a></span>wickr_dev_info_create_new()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__dev__info.html">wickr_dev_info_t</a>* wickr_dev_info_create_new </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structwickr__crypto__engine.html">wickr_crypto_engine_t</a> *&#160;</td>
          <td class="paramname"><em>crypto</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td>
          <td class="paramname"><em>system_id</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Generate a new randomized device info set from a system identifier. This function uses crypto engine 'crypto' to generate a random 'dev_salt' value, and then calls 'wickr_dev_info_derive' with the resulting random 'dev_salt', crypto engine, and provided 'system_id' values</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">crypto</td><td>a crypto engine that supports a PRNG, SHA512, and SHA256 functions </td></tr>
    <tr><td class="paramname">system_id</td><td>a buffer representing data optimally unique to your system. It is used as the basis of generating the 'system_salt' property. See property declaration of 'system_salt' in '<a class="el" href="structwickr__dev__info.html" title="Device Information used to make a uniquely identifying set of data for each context running the Wickr...">wickr_dev_info</a>' </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the output of 'wickr_dev_info_derive' with a randomly generated 'dev_salt' </dd></dl>

</div>
</div>
<a id="ga7f81b96fc222560762d608772b3f44bd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7f81b96fc222560762d608772b3f44bd">&#9670;&nbsp;</a></span>wickr_dev_info_derive()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__dev__info.html">wickr_dev_info_t</a>* wickr_dev_info_derive </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structwickr__crypto__engine.html">wickr_crypto_engine_t</a> *&#160;</td>
          <td class="paramname"><em>crypto</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td>
          <td class="paramname"><em>dev_salt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td>
          <td class="paramname"><em>system_id</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Derive a set of salt values and identifiers. Creates 'system_salt' by taking a SHA256 hash of the system_id. Creates 'msg_proto_id', and 'srv_comm_id' properties by taking a SHA512 of of 'system_id' using 'dev_salt' as a salt, and then splits by using the first 32 bytes as 'msg_proto_id', and the last 32 bytes as 'srv_comm_id'</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">crypto</td><td>a crypto engine that supports a PRNG, SHA512, and SHA256 functions </td></tr>
    <tr><td class="paramname">dev_salt</td><td>a randomly generated device salt to be used as input for generating identifiers </td></tr>
    <tr><td class="paramname">system_id</td><td>a system level identifier to be used as input to generating a 'system_salt' value, as well as identifiers </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a newly allocated device info set owning the reference to dev_salt, and with newly generated values for 'system_salt', 'msg_proto_id', and 'srv_comm_id'. NULL if derivation fails </dd></dl>

</div>
</div>
<a id="ga09ee324a0e0e6a0451aa53031eecb324"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga09ee324a0e0e6a0451aa53031eecb324">&#9670;&nbsp;</a></span>wickr_dev_info_destroy()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void wickr_dev_info_destroy </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structwickr__dev__info.html">wickr_dev_info_t</a> **&#160;</td>
          <td class="paramname"><em>info</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Destroy a device info set</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">info</td><td>a pointer to a device info set to destroy. Properties of '*info' will also be destroyed </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.15
</small></address>
</body>
</html>
